UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4unYEqNZMKKv4x2zTsxocSmMa/tnCnDy5QyCeD622Fk='
WHERE
key_id = '3d1d1c58bda2f6a7948d0d9a8e0e5f8a71579166d1b3a33ef4148feb9b2abad8'
AND (
token = '4unYEqNZMKKv4x2zTsxocSmMa/tnCnDy5QyCeD622Fk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)