UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '41F+e/ShazUOPnVRuxxI07I0imhdPSdgSuKkEQUqEE8=' 
WHERE 
  key_id = '8b6785321ed09e33e15a70317bac45eb5a230d5e9ef39077a3cb594f95bb0b1b' 
  AND (
    token = '41F+e/ShazUOPnVRuxxI07I0imhdPSdgSuKkEQUqEE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031