UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'llanNe9gBadJWPddXu11nxLSjReIRUCKNOrLZm01thI='
WHERE
key_id = '1b27eaad13dfeec949e93b6e08d9c4098c173deec49c9164f7483677ed465d38'
AND (
token = 'llanNe9gBadJWPddXu11nxLSjReIRUCKNOrLZm01thI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)