UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NbjXq4MuxB9hcRIORhAUGYoBNwT1XJSVAF71CILeaCo=' 
WHERE 
  key_id = '9b4372bdb8c5905bf8c1952b33d91cb7a5d27f47816c52ae144eb8f7043236fe' 
  AND (
    token = 'NbjXq4MuxB9hcRIORhAUGYoBNwT1XJSVAF71CILeaCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026