UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7T/+Z8Yh2JOEMrUXY3t/7zkyOU3u6PydVwHL4BqvL/s=' 
WHERE 
  key_id = 'da0b119f03f24e0a2c4204786ec05068bd32039267968f6faaa778a6c08d3b38' 
  AND (
    token = '7T/+Z8Yh2JOEMrUXY3t/7zkyOU3u6PydVwHL4BqvL/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028