UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5v2xuEp4AAuaOWD+FuCK03TkhVDZPJOaTf0Dwv1TysI='
WHERE
key_id = '96a931d79bd27cff1c5997328aa80d2bb3f3df7fb795a265408b00e2cd77d948'
AND (
token = '5v2xuEp4AAuaOWD+FuCK03TkhVDZPJOaTf0Dwv1TysI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)