UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WM4zq5xH+S+8vCAQ0Xg65yjNBaPJv08bSe/0fty37o8='
WHERE
key_id = '9f02f440c3853a41264496317dc124a628f00a16cdca7886bded704992c07091'
AND (
token = 'WM4zq5xH+S+8vCAQ0Xg65yjNBaPJv08bSe/0fty37o8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)