UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hIMkYPnlmHucHW3/cJXfRjxZF9YN6RfdtBavJvZmzUk='
WHERE
key_id = 'ff5a4a6844088e006a6050f184ea79b35fc4c4d166c86666cdc603dfbdcfd737'
AND (
token = 'hIMkYPnlmHucHW3/cJXfRjxZF9YN6RfdtBavJvZmzUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)