UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'osXaXBS82OmXOl1iWrr6TIx8aIU7EkeNe1bUF0RiGtc='
WHERE
key_id = '3cad5342c302b70b4041937686a15f34c9dbc380b9fccb43269f63fbe00acd19'
AND (
token = 'osXaXBS82OmXOl1iWrr6TIx8aIU7EkeNe1bUF0RiGtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)