UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OJpON3uNNNwkoM2waoKUOyF5QX/H7TTtpuhL6kZx8Tg='
WHERE
key_id = 'cc1ae911d538219c47b2a9f0f4bddb1760fc43e4e23ddfad4d8d8c448bdc5483'
AND (
token = 'OJpON3uNNNwkoM2waoKUOyF5QX/H7TTtpuhL6kZx8Tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)