UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ceXLMp8B7nvMG6QuCnJk34kZJNCMFzx3rcf04xNj4/E='
WHERE
key_id = '3ed17262121711f2b3ed8551a72f84eb59eb738ecb42d8fe255c3aaaad844d7e'
AND (
token = 'ceXLMp8B7nvMG6QuCnJk34kZJNCMFzx3rcf04xNj4/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)