UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UMqFO9e6m5CsaODQ/CsZUwrxIDmxRtdm2htZ9FubDBE=' 
WHERE 
  key_id = '3a7211cf1dcca0e5ff2756c17e17eb68f51eb2bba936d0d955a016d51e081619' 
  AND (
    token = 'UMqFO9e6m5CsaODQ/CsZUwrxIDmxRtdm2htZ9FubDBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020