UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V+vbygy36KM1L9gX/ajeYhZ+XcgTwwBs+HdBU6LwZmg='
WHERE
key_id = '6e0fd80bb1393ac0cb2967a32eac583ecfebeb3550f6162062eeb1c115ebdb60'
AND (
token = 'V+vbygy36KM1L9gX/ajeYhZ+XcgTwwBs+HdBU6LwZmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)