UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PD75fUfn1GnXAuIus4hSu/LiBuRZz6Dx1VDZBKAjVKU=' 
WHERE 
  key_id = 'f94c81907bf25c1cd38287eb48c19244ebf7600e1760ce5f60599f5eaa7adc28' 
  AND (
    token = 'PD75fUfn1GnXAuIus4hSu/LiBuRZz6Dx1VDZBKAjVKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029