UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6wTYi7RKbRm8g71G+Iiu5uy4pWpXXhisZTZErtGuDIA='
WHERE
key_id = '63635e950ead3add750a178506fdd9cbdc3bae42b7c493d00b512301877e5f3e'
AND (
token = '6wTYi7RKbRm8g71G+Iiu5uy4pWpXXhisZTZErtGuDIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)