UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w3rUquJ8aXGfAzPXZ9FLvSxiopIqdcB50BcuCDZ2uyU='
WHERE
key_id = 'db909924c47b30a26d611563eb3a300db0304adf0a18a77da8106f09d7048ee9'
AND (
token = 'w3rUquJ8aXGfAzPXZ9FLvSxiopIqdcB50BcuCDZ2uyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)