UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I7Mj8svpxIo6CJDS4eEVj3M4HMGVNJST81hBuqYVj1Y=' 
WHERE 
  key_id = 'bbf519b24ec5dbabd903b8d4192ffdc47ddefced044ab0aad02ef66d2a9eba4b' 
  AND (
    token = 'I7Mj8svpxIo6CJDS4eEVj3M4HMGVNJST81hBuqYVj1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047