UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r/VIRL/vXfjIjTYqvXB54RigsZq5imOlnBlbM1Ti2pE='
WHERE
key_id = 'cbaab86e4200f598b60023722c36e288e9c89ff01bd92bd3d83f23127285d0f9'
AND (
token = 'r/VIRL/vXfjIjTYqvXB54RigsZq5imOlnBlbM1Ti2pE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)