UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7RKMEGJa9OCg7qxKkbsVZlmhqv/PICqQCx9nCFPSLEA='
WHERE
key_id = '3451fb02b5f6e4a801ed1788a13a2b40adf4dd70025e07538993431cf16511fa'
AND (
token = '7RKMEGJa9OCg7qxKkbsVZlmhqv/PICqQCx9nCFPSLEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)