UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bx3dNRZR0p/8UZsfsXgJQ+2VaZ6nuk7rvcmPFO+e8yQ='
WHERE
key_id = 'a18046e51db6eb2a6fc2c9a086094c19747fdbf57c2d89994afb99693c7c3510'
AND (
token = 'Bx3dNRZR0p/8UZsfsXgJQ+2VaZ6nuk7rvcmPFO+e8yQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)