UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AFIOA43oRqsN1U8NP1cEDmHYQleGi1s83V5vdYQtkbI=' 
WHERE 
  key_id = '030c20e73c48d51f2e73e54f52dc2e71c0ec1d2f7ec26c42319a58750c463c45' 
  AND (
    token = 'AFIOA43oRqsN1U8NP1cEDmHYQleGi1s83V5vdYQtkbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022