UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MKuX7cFZ/TXdURN7xexNEsx/IZ/m8BjX/SA8gVsdY+4='
WHERE
key_id = 'db0211cd5adb8468e657b986d65c26ad4d9efd92219fa232802bb36bd409a5c6'
AND (
token = 'MKuX7cFZ/TXdURN7xexNEsx/IZ/m8BjX/SA8gVsdY+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)