UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSI+Ey3BxJeGemZDwIOXhQ6IeZ0y3znWrbtDqMTtoa4='
WHERE
key_id = '805c4fa3381f7fc8935f56ac764ae6e8a27698d5d227ed1093e922ceb04b8609'
AND (
token = 'HSI+Ey3BxJeGemZDwIOXhQ6IeZ0y3znWrbtDqMTtoa4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)