UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DMYhUYI1YARz1KcoQbIAptT8lNg+U7zt2bFwy9kicCY=' 
WHERE 
  key_id = '04ad448f9fbd2d4b7e540e9a9c6e958b8e9f152c50323873defd470ebd7a71e0' 
  AND (
    token = 'DMYhUYI1YARz1KcoQbIAptT8lNg+U7zt2bFwy9kicCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030