UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DZo2D8zQT7Kn3L2jdJRc0L/kRjR2MxzlWFismajcSEQ=' 
WHERE 
  key_id = '5faad9fbc0e8e294469c8c1ad755233de8beb56073a3708547924497f172fc89' 
  AND (
    token = 'DZo2D8zQT7Kn3L2jdJRc0L/kRjR2MxzlWFismajcSEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019