UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7LqvYcHdMcYs0b5OzDYhtpF5NwWpifm8+M6RwyFBrxQ='
WHERE
key_id = '739317b9e6d603a31b9a676b3dacecd34b8a6e32c0341789412f797cbbe5948d'
AND (
token = '7LqvYcHdMcYs0b5OzDYhtpF5NwWpifm8+M6RwyFBrxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)