UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2xfn97gErOk3oXcgRARj13yxd2NFo0adibKDC4bOo1g=' 
WHERE 
  key_id = '947cb2cf3ebca5aaac958270bb49c1ec30b59247e0f27a9751d4aa2e2cd5a8a3' 
  AND (
    token = '2xfn97gErOk3oXcgRARj13yxd2NFo0adibKDC4bOo1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020