UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TUKoYbtI5WPOu3KKPqS1bvcWdcG+aXzfLcCCasRuc8A='
WHERE
key_id = 'c85df8484f2dec3e4ec279b191193b6dfe07da83e058018f5bf1f94af2ba7153'
AND (
token = 'TUKoYbtI5WPOu3KKPqS1bvcWdcG+aXzfLcCCasRuc8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)