UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pCDLhU9IPT0Xm6whdMjM2T+IKazwn61IRwPhYqJ8/TE=' 
WHERE 
  key_id = '82c70b4335a5152a7d304a279e86e303d539c28b003eb67cecde5f636584dca1' 
  AND (
    token = 'pCDLhU9IPT0Xm6whdMjM2T+IKazwn61IRwPhYqJ8/TE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035