UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '42y4vw7Y2iTmmEXpMelkTZglpkSYqqaSVnhwqOTBgbI=' 
WHERE 
  key_id = '2b0764c3060daa3f926bf826a5f67994079daed117cea1dd4c7e2779d6e544fe' 
  AND (
    token = '42y4vw7Y2iTmmEXpMelkTZglpkSYqqaSVnhwqOTBgbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034