UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DhoX0ly+FEAZWQMXiGMQxzHk7SNbB0Ek4uLL4SQXuvY=' 
WHERE 
  key_id = 'dc5b360f18a655319d6924fa9fa28a459d15792eebbbcf3359d558225fa058fb' 
  AND (
    token = 'DhoX0ly+FEAZWQMXiGMQxzHk7SNbB0Ek4uLL4SQXuvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029