UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qnvg7/Xgu6MpIMC4oWCMAm+x6OPo9dxNfASQcWv/o2M=' 
WHERE 
  key_id = '39a1f945656e6403a7ceb6e3836d7e21c776d5fb1549c017d4416384896bd80a' 
  AND (
    token = 'qnvg7/Xgu6MpIMC4oWCMAm+x6OPo9dxNfASQcWv/o2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018