UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFMfxylUnj8JAJhgckJd6ANLpELbzFhkSDy8QBKZV20=' 
WHERE 
  key_id = '951312a41ef9bb281b5e2fa3dbcd43c8f937777012835c2db56384b828f9f9ca' 
  AND (
    token = 'hFMfxylUnj8JAJhgckJd6ANLpELbzFhkSDy8QBKZV20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023