UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sQ+76owJUs21jVTDrO8fUmy6Y2qW15nktLggp7SJBQw='
WHERE
key_id = '2aae3967ca6007c58a4ae65b29f19de7aba0f31f32e37f9fe213336a0f774f01'
AND (
token = 'sQ+76owJUs21jVTDrO8fUmy6Y2qW15nktLggp7SJBQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)