UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mrbyTVw/rG4lxK7ptFJ6+qp5v0QaQkL8x6SjVd+WREc='
WHERE
key_id = 'ff3de37760878f6cd2bb6bba0b2124ff5519a92c3fae85e8c2c467ba227e40ac'
AND (
token = 'mrbyTVw/rG4lxK7ptFJ6+qp5v0QaQkL8x6SjVd+WREc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)