UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GS+LnBlemcps5V2tm2cRrQgwJVRciM+uNICKXqXnG7Y=' 
WHERE 
  key_id = 'f3511a77e75debbc63e9f887cef9c8fa027e4f675e0125b86ce763f0b7e832aa' 
  AND (
    token = 'GS+LnBlemcps5V2tm2cRrQgwJVRciM+uNICKXqXnG7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034