UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rBMbv5LoLqfs7hbCu4evhjy4zTgxvlPHFOFy9ThhCVQ='
WHERE
key_id = '088ee847d82ed77009838471ee7af2db9685065d6c70e4355d142cc47ca87109'
AND (
token = 'rBMbv5LoLqfs7hbCu4evhjy4zTgxvlPHFOFy9ThhCVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)