UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ed2GgMhjnnrhxnrYDPASuXU/8XHHjkF4xsMWt2p3DY4=' 
WHERE 
  key_id = '57a8eb1bd6ba1470996db1166d77a4ccbb297a8ed22228cebfc8963b26c6244b' 
  AND (
    token = 'ed2GgMhjnnrhxnrYDPASuXU/8XHHjkF4xsMWt2p3DY4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034