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

Query time 0.00028