UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TAmJ2DyadDmGO+1PwFP1+ZB0xaHHk6TaD6igSAzZBis=' 
WHERE 
  key_id = '3ba49c3c7544eabbed003bf7f6b63b8944ecdd2d20f4f8babece1838954ac4c6' 
  AND (
    token = 'TAmJ2DyadDmGO+1PwFP1+ZB0xaHHk6TaD6igSAzZBis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032