UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3/D7selucVNEmAm/IhdOoi55hHeFSv4ttYfo7hHc2hI=' 
WHERE 
  key_id = '6ed14bbe4e44fc5cc7384ac6a224c12a1d585b04c9b6992aaa2bc443cd9322f8' 
  AND (
    token = '3/D7selucVNEmAm/IhdOoi55hHeFSv4ttYfo7hHc2hI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023