UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pSD+G3bugITGUCQLNvIa2fA8vdTs7SI79QCrqYs9wzc=' 
WHERE 
  key_id = '3a26d371f58fbe97fc4c819f232efba55ee3e465887eae0a31ab36709c95dddd' 
  AND (
    token = 'pSD+G3bugITGUCQLNvIa2fA8vdTs7SI79QCrqYs9wzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028