UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4H76py1aroPQ3cHBo6s6RiQ3hPXG2upaAN3vbEnYfdQ=' 
WHERE 
  key_id = '5f47612290a43ec31b028d70f4a1d0f58163d41aacd3dbf1564eed8d2b11c63b' 
  AND (
    token = '4H76py1aroPQ3cHBo6s6RiQ3hPXG2upaAN3vbEnYfdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021