UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bRYr1rcxB9L/VuCd0QQJjDgfF9rql0SnX7xwA3Xd9A4=' 
WHERE 
  key_id = '0490eac04ca952a5f7bd0ad616f9c34f1387c6f336646e544b972b754fdcd554' 
  AND (
    token = 'bRYr1rcxB9L/VuCd0QQJjDgfF9rql0SnX7xwA3Xd9A4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088