UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V1L7A9F8Qo9TWaAtZ3GyGzxCe5j2LWmVJv27q4cbE+0='
WHERE
key_id = 'a15fd9f2da9b27cddc720aa580e04d1114a2edab204332a4cb33ea8dd93a6925'
AND (
token = 'V1L7A9F8Qo9TWaAtZ3GyGzxCe5j2LWmVJv27q4cbE+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)