UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QQvtemIqBdivSvH9MgY0EV6hjL/9NPj++n8HN/9e48E=' 
WHERE 
  key_id = '9cabea7def77a0405c4b679b3086dce3fac7afbfcbf8cce64e323cd9225afea4' 
  AND (
    token = 'QQvtemIqBdivSvH9MgY0EV6hjL/9NPj++n8HN/9e48E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028