UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XCuBlDTfnA/NAWnv312VNZJq5F7qty+CCwsJxFW8cRs='
WHERE
key_id = '4f36c8504ca3f61a7386c2cc8e3b445448b645bf0f5012e28a2a820b152ee466'
AND (
token = 'XCuBlDTfnA/NAWnv312VNZJq5F7qty+CCwsJxFW8cRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)