UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4atF9BiIlR5sfdFoLwAFCszkG2McH+3a9rQXa2LtbLI='
WHERE
key_id = 'adbafe9a132b1138c05e3c4dcdffb60c2d81a8968e0e8d1d8f9f8884ecb4c90a'
AND (
token = '4atF9BiIlR5sfdFoLwAFCszkG2McH+3a9rQXa2LtbLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)