UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4iDolYm82RGnQFagmm2BBM0JNNrTRc7TS/cl6N3BdVI='
WHERE
key_id = 'ebe01a65af3a4ef5ed5f5278570bd9dd2923273cb70071205b1adee067e53440'
AND (
token = '4iDolYm82RGnQFagmm2BBM0JNNrTRc7TS/cl6N3BdVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)